package cn.yunyichina.provider.pay.dao;

import cn.yunyichina.provider.framework.annotation.MyBatisRepository;
import cn.yunyichina.provider.framework.mvc.dao.BaseDao;
import cn.yunyichina.provider.framework.mvc.dao.msdatasource.DataSource;
import cn.yunyichina.provider.framework.page.PageInfo;
import cn.yunyichina.provider.pay.entity.PaymentJournal;
import cn.yunyichina.provider.pay.entity.PaymentJournalSum;
import cn.yunyichina.provider.pay.vo.FinanceChannelVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
*
* @Author auto_gen_by_tool
* @CreatedTime 2016-10-20 19:05:38
*/
@Repository
@MyBatisRepository
public interface PaymentJournalDao extends BaseDao<cn.yunyichina.provider.pay.entity.PaymentJournal>{

	Map<String,Object> selectStat(@Param("wheres") PaymentJournal paymentJournal);

	List<Map> selectPatdetails(@Param("wheres") PaymentJournal wheres, @Param("selects") List<String> selects, @Param("orderColumns") List<String> orderColumns, @Param("isAsc") Boolean isAsc, @Param("pageInfo") PageInfo pageInfo);
	/**
	 *
	 * @param beginYytPayTime
	 * @param endYytPayTime
	 * @param payAppId
	 * @param platformId
	 * @param orgId
	 * @return
	 */
	PaymentJournal queryFinanceSummaryOneday(@Param("beginPayTime")String beginPayTime,@Param("endPayTime")String endPayTime,@Param("payAppId")String payAppId,@Param("platformId")String platformId,@Param("orgId")String orgId);


    FinanceChannelVo selectSummaryRealHis(@Param("orgId")String orgId , @Param("beginCheckTime")String beginCheckTime, @Param("endCheckTime")String endCheckTime , @Param("payMode")String payMode, @Param("platformId")String platformId);

    List<PaymentJournal> selectjournals(@Param("orderNo") String orderNo, @Param("date") String date, @Param("payMode") Short payMode, @Param("payList") List<String> payList);

    List<PaymentJournal> selectjournalsforPaymode(@Param("orgId") String orgId, @Param("payMode") Short payMode, @Param("beginPayTime") String beginPayTime, @Param("endPayTime") String endPayTime, @Param("platformId") String platformId);

    void updateClear(PaymentJournal data);

    List<PaymentJournal> selectDetailsPatstatistics(@Param("beginPayTime") String beginPayTime, @Param("endPayTime") String endPayTime, @Param("orgId") String orgId, @Param("platformIds") List<String> platformIds);

    List<PaymentJournal> selectByOrderNoAndStatuses(Map<String, Object> params);

	PaymentJournalSum selectCountByListStatus(Map<String, Object> params);

    List<PaymentJournal> selectByListStatus(Map<String, Object> params);

    
    void updatePaymentJournalRefundFlagByOrderNo(PaymentJournal paymentJournal);

	//@DataSource("slave")
	List<Map<String,Object>> paymentJournalQuery(Map<String, Object> params);
	List<PaymentJournal> selectByListStatusForFuyin(Map<String, Object> params);


}